#ifndef SUDOKU_H
#define SUDOKU_H   

/*
 * Copyright (c) 2010
 * All Rights Reserved.
 *
 * 
 * Author : Madhur Raj
 */

#include <sys/time.h>
#include <time.h>
#include <stdio.h>
#include <stdlib.h>

#define CR 13
#define LF 10
#define EF 26

#define SUCCESS 0
#define FAILED  -1
#define DATINSUFF      1


typedef struct _box
{
   int boxNum;
   int probCount[3][3];           /* Probable Values */
   int probSeq[3][3][9];    /* Probable Sequence */
   int succCount;           /* Succesful Values */
   int succSeq[3][3];       /* Success Sequence */
}Box;

Box mBox[3][3];

int presetVal[9][9];
static int globSucc;

int message[]={0x68542000,0x65722065,0x6e6f7361,0x726f6620,0x756f7920,0x206f7420,0x20656573,0x73696874,0x73656d20,0x65676173,0x6e616320,0x20656220,0x206f7774,0x73616572,0x3a736e6f,0x2e31200a,0x20504e20,0x6148202d,0x2e206472,0x756f5920,0x67696d20,0x68207468,0x20657661,0x64757473,0x20646569,0x756f6261,0x2d4e2074,0x6f432050,0x656c706d,0x61206574,0x4920646e,0x6d6f636e,0x74656c70,0x72702065,0x656c626f,0x202c736d,0x20747562,0x6d612049,0x72757320,0x6f792065,0x61682075,0x6e206576,0x7520746f,0x7265646e,0x6f6f7473,0x68742064,0x65722065,0x6d206c61,0x696e6165,0x6f20676e,0x74692072,0x70612073,0x63696c70,0x6f697461,0x54202e6e,0x70206568,0x6c626f72,0x77206d65,0x68636968,0x756f7920,0x76616820,0x69672065,0x206e6576,0x61207369,0x504e206e,0x72614820,0x49202e64,0x73692074,0x736f7020,0x6c626973,0x6f742065,0x6e696620,0x20612064,0x756c6f73,0x6e6f6974,0x20796220,0x626f7270,0x6c696261,0x2e797469,0x74754220,0x68204920,0x20657661,0x74732061,0x676e6f72,0x6c656220,0x20666569,0x74616874,0x6f727020,0x69626162,0x7974696c,0x20736920,0x20726f66,0x6f696469,0x61207374,0x6620646e,0x736c6f6f,0x6877202c,0x6863206f,0x20657361,0x20656874,0x64616873,0x6120776f,0x7320646e,0x6c207961,0x20656669,0x62207369,0x6b6e616c,0x6854202e,0x20657265,0x6e207369,0x7270206f,0x6261626f,0x74696c69,0x6e692079,0x66696c20,0x69202c65,0x73692074,0x776c6120,0x20737961,0x6f736261,0x6574756c,0x6c41202e,0x73796177,0x61686320,0x72206573,0x6f736165,0x6f66206e,0x68732072,0x776f6461,0x6548202e,0x2065636e,0x6d612049,0x746f6e20,0x696f6720,0x7420676e,0x6f73206f,0x2065766c,0x73696874,0x62727020,0x6c696261,0x69747369,0x75732063,0x756b6f64,0x200a202e,0x49202e32,0x6c61766e,0x49206469,0x7475706e,0x59203a20,0x6320756f,0x70206e61,0x7361656c,0x65722065,0x63656863,0x6f79206b,0x69207275,0x7475706e,0x2e73};

/* Probability Sudoku Level 3 and above */

typedef struct _node
{
   int nr;
   int nc;
   int row;
   int col;
   int probCount;
   int probSeq[9];
   int counter;
   int vFlag;
   struct _node *next;
   struct _node *prev;
}Node;

Node *gNode;
int gNumNode;
int gRunSuccess;

void solveProbabilitySudoku();


#endif /* SUDOKU_H */
